package com.thunder.reader.transaction;

import java.util.ArrayList;


public class Observable {
    private ArrayList<Observer> mObservers;
    public Observable() {
        mObservers = new ArrayList<Observer>();
    }
    
    public void registerObserver(Observer ob) {
        mObservers.add(ob);
    }
    
    public void unregisterObserver(Observer ob) {
        mObservers.remove(ob);
    }
    
    public void notifyObservers(TransactionData data) {
        assert(mObservers == null);
        for (Observer ob : mObservers) {
            ob.update(data);
        }
    }
}